﻿@using ControleRepresentante.Logic.Models
@using WebSite.ViewModels
@using WebSite.ViewModels.DetailsViewModels
@using System.Web.Mvc

@{
    Layout = null;
}

@model ClienteDetailsViewModel
@{ Cliente cliente = (Cliente)Model.Model; }
<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@cliente.RazaoSocial</title>
    <link href="@Url.Content("~/Scripts/bootstrap/css/bootstrap.min.css")" rel="stylesheet">
</head>
<body>
    <table style="border: black solid 1px">
        <tr>
            <td colspan="2">
                <address>
                    <strong><span class="glyphicon glyphicon-user" aria-hidden="true"></span> @cliente.RazaoSocial</strong><br />
                    Nome Fantasia: @cliente.NomeFantasia<br />
                    Inscrição Estadual: @cliente.InscricaoEstadual<br />
                    CNPJ: @cliente.CNPJ
                </address>
            </td>
        </tr>
        <tr>
            <td>
                <address>
                    <strong><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Contato</strong><br />
                    Celular: @cliente.ContatoCelular<br />
                    E-mail: @cliente.ContatoEmail<br />
                    Telefone: @cliente.ContatoTelefone<br />
                </address>
            </td>
            <td>
                <address>
                    <strong><span class="glyphicon glyphicon-home" aria-hidden="true"></span> Endereço</strong><br>
                    @cliente.GetEnderecoFieldString()<br>
                    @cliente.EnderecoBairro - @cliente.EnderecoCEP<br>
                    @cliente.EnderecoCidade - @cliente.EnderecoEstado
                </address>
            </td>
        </tr>
        <tr>
            <td>
                @{Endereco endereco = cliente.EnderecoEntrega;}
                @if (endereco != null)
            {
                    <address>
                        <strong><span class="glyphicon glyphicon-send" aria-hidden="true"></span> Endereço de Entrega</strong><br>
                        @endereco.ToEnderecoFieldString()<br>
                        @endereco.Bairro - @endereco.CEP<br>
                        @endereco.Cidade - @endereco.Estado
                    </address>
                }
            </td>
            <td>
                @{endereco = cliente.EnderecoCobranca;}
                @if (endereco != null)
                {
                    <address>
                        <strong><span class="glyphicon glyphicon-usd" aria-hidden="true"></span> Endereço de Cobrança</strong><br>
                        @endereco.ToEnderecoFieldString()<br>
                        @endereco.Bairro - @endereco.CEP<br>
                        @endereco.Cidade - @endereco.Estado
                    </address>
                }
            </td>
        </tr>
    </table>

    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/bootstrap/js/bootstrap.min.js")"></script>
    <script language="javascript" type="text/javascript">
        $(document)
            .ready(function () {
                window.print();
            });
    </script>
</body>
</html>
